package com.example.mapper;

import com.example.pojo.entity.Museum;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface MuseumMapper {

    @Insert("insert into  `museum` (name,open_time,head,address) values (#{name},#{openTime},#{head},#{address})")
    void insert(Museum museum);

    @Update("update `museum` set name = #{name},open_time = #{openTime},head = #{head},address = #{address} where id = #{id}")
    void updateById(Museum museum);

    @Delete("delete from `museum` where id = #{id}")
    void removeById(Integer id);

    @Select("select * from `museum` where id = #{id}")
    Museum getById(Integer id);

    List<Museum> selectByPage(String name);

    @Select("select * from `museum` where name = #{name}")
    Museum selectByName(String name);
}
